<template>
  <div class="rightrotation ">
    <el-carousel class="rotation-container" :height="rotationheight" trigger="click" :interval="5000">
      <el-carousel-item class="rotation-carousel-item" v-for="(item,index) in rotationlist" :key="index" :style="'background-image:url('+item.img+')'">
        <p class="rotation-carousel-title" v-if="item.title">{{item.title}}</p>
      </el-carousel-item>
    </el-carousel>
  </div>
</template>

<script>
  export default{
    name:'RightRotation',
    props:{
      rotationheight:String,
      rotationlist:Array
    }
  }
</script>

<style scoped>
  .rightrotation{
    position: relative;
    /* height: 330px; */
  }
  .rotation-container{
    width: 100%;
    position: relative;
    border-radius: 2px;
  }
  .rotation-carousel-item{
    width: 100%;
    height: 100%;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
  }
  .rotation-carousel-item::before{
    content: "";
    position: absolute;
    width: 100%;
    height: 48px;
    border-radius:2px;
    bottom:0;
    left: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, .7));
  }
  .rotation-carousel-title{
    position: absolute;
    color:#fff;
    bottom:10px;
    left:12px;
    display: flex;
    align-items: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    width: 70%;
    box-sizing: border-box;
  }
</style>
<style>
  .rightrotation .el-carousel__arrow {
    display: none;
  }

  .rightrotation .el-carousel__indicators--horizontal {
    left: auto;
    right: 12px !important;
    bottom: 0;
    transform: translateX(0);
  }

  .rightrotation .el-carousel__indicator:hover .el-carousel__button {
    opacity: 1 !important;
  }

  .rightrotation .el-carousel__button {
    width: 10px;
    height: 10px;
    border: 2px solid #fff;
    box-sizing: border-box;
    border-radius: 50%;
    background-color: #FFFFFF;
    opacity: 1;
    transition: all .3s;
  }

  .rightrotation .el-carousel__button:hover {
    background-color: #00a4d6;
    transform: scale(1.3);
    opacity: 1;
  }

  .rightrotation .is-active .el-carousel__button {
    background-image: url(../../assets/img/banner_bottom_icon.png) !important;
    background-repeat: no-repeat;
    background-size: cover;
    border-width: 0;
    border-color: transparent;
    transform: scale(1.8);
    background-color: transparent;
  }

  .rightrotation .el-carousel__indicator--horizontal {
    margin-left: 3px;
  }
</style>
